package cn.scnu.component.exception;


import cn.scnu.common.error.IErrorInfo;

/**
 * @author hqz
 * @updateTime 2022/9/8 13:43
 * @description  自定义API异常
 */
public class ApiException extends RuntimeException {
    private IErrorInfo errorInfo;
    
    public ApiException(IErrorInfo errorInfo) {
        super(errorInfo.getErrorMsg());
        this.errorInfo = errorInfo;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public IErrorInfo geterrorInfo() {
        return errorInfo;
    }
}
